var alertFlag = false;
var host = "http://www.txiaoyuan.cn/";
var loading;
function removeAlertTips(){
      var alertDiv = document.getElementById("alertTips").parentNode;
      document.body.removeChild(alertDiv);
      alertFlag = false;
}
window.alert = function(str){
        if(alertFlag){
          return;
        }
        alertFlag = true;
        var alertFram = document.createElement("DIV");
        strHtml = "<div id=\"alertTips\" style=\"min-width: 150px;max-width: 240px; min-height: 40px;border-radius: 14px; height: 40px;position:absolute; left: 0; top: 0; right: 0; bottom: 0;z-index: 1000001;margin: auto;line-height: 40px;background: #000000;opacity: 1;color: #fff;text-align: center;font-size: 14px;\">"+str+"</div>";
        alertFram.innerHTML = strHtml;
        document.body.appendChild(alertFram);
        alertFram.focus();
        setTimeout('removeAlertTips()',3000);
};

(function(){
    var style = '<style>.loading_mask{z-index:99999999;position:fixed;top:0;bottom:0;display:none;left:0;right:0;background:rgba(50,50,50,0.01);text-align:center;font-size:0}.loading_mask:after{content:"";display:inline-block;height:100%;vertical-align:middle}.loading{display:inline-block;vertical-align:middle;width:40px;height:40px;  background-image: url('+host+'common/img/facebook.svg); background-size: 100% 100%;font-size:16px}</style>';
    var temp = '<div class="loading_mask" id="load"><div class="loading"></div></div>';
    $('body').append(style).append(temp);
    loading = {
        show:function(){
            $('#load').show();
        },
        close:function(){
            setTimeout(function(){
                $('#load').hide();
            },600);

        }
    }
})();


